/**
 * 背景层
 */
define(['createjs'],function(createjs){
	var BGLayer = function(layer,width,height){
		this._layer = layer;
		this._width = width;
		this._height = height;
		this._bgImg = false;

		/**
		 * 画画
		 * @param {Object} imageObj 要画的对象
		 */
		this.draw = function(imageObj){
			this._layer.removeAllChildren ();
			this._bgImg = new createjs.Bitmap(imageObj.imageObj);
			this._bgImg.set({
				scaleX : this._width/imageObj.imageObj.width,
				scaleY : this._height/imageObj.imageObj.height,
			});
			this._layer.addChild(this._bgImg);
		}
		
		/**
		 * 清空
		 */
		this.clear = function(){
			this._layer.removeAllChildren();
		}
		
	};
	
	return BGLayer;
});